﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Sale_Operation;
using Sale_Common;
using SaleSystem;
using Sale_Model;

namespace SaleSystem.Other
{
    public partial class frm_SystemLogList :PageBase
    {
        #region PageEvent
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
              
               
                GetAndBind();
            }
            else if (Request[LinkService.RefreshTag] == LinkService.RefreshString)
            {
                GetAndBind();
            }
        }
        protected void bnSearch_Click(object sender, EventArgs e)
        {
            GetAndBind();
        }

        protected void bnDelete_Click(object sender, EventArgs e)
        {
            Manager.Delete();
            GetAndBind();
        }
        
        protected void gv_List_RowDataBound(object sender, ExtAspNet.GridRowEventArgs e)
        {
        }
        protected void gv_List_RowCommand(object sender, ExtAspNet.GridCommandEventArgs e)
        {
          
        }
        protected void gv_List_PageIndexChange(object sender, ExtAspNet.GridPageEventArgs e)
        {
            gv_List.PageIndex = e.NewPageIndex;
            GetAndBind();
        }
        #endregion

        #region Method
        private void BindDropDownList()
        {

           

        }
        private void GetAndBind()
        {
            FormatGrid(gv_List);
            InitCondition();
            dtList = Manager.GetList(strCondition, gv_List.PageIndex + 1, ref iRecordCount);
            gv_List.DataSource = dtList;
            gv_List.DataBind();
            gv_List.RecordCount = iRecordCount;
        }
        /// <summary>
        /// 获取查询条件
        /// </summary>
        public override void InitCondition()
        {
            strCondition = "";
            
            if (!string.IsNullOrEmpty(strCondition))
                strCondition = strCondition.Substring(0, strCondition.Length - 4);

        }
        #endregion

        #region Property
        SystemLogOp Manager = new SystemLogOp();
        #endregion

        protected void gv_List_PageIndexChange1(object sender, ExtAspNet.GridPageEventArgs e)
        {
            gv_List.PageIndex = e.NewPageIndex;
            GetAndBind();
        }
    }

}
